package com.aaa.statistics.controller.api;

import com.aaa.entity.HisCareOrderItem;
import com.aaa.statistics.service.SalesService;
import com.aaa.statistics.vo.HisCareOrderItemSaleVo;
import com.aaa.statistics.vo.HisCareOrderItemVo;
import com.aaa.statistics.vo.HisVO;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author ：晋升（js20020923@qq.com）
 * @date ：Created in 2023/3/29 11:39
 * @description：查询药品销售
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("statistics/api/sales")
public class ApiSalesController {
    @Autowired
    private SalesService salesService;

    @PostMapping("/list/{currentPage}/{pageSize}")
    public Result<IPage<HisCareOrderItem>> list(
            @PathVariable Integer currentPage,
            @PathVariable Integer pageSize,
            @RequestBody HisVO hisVO
    ) {
        System.out.println("=================" + hisVO);
        return salesService.HisgetByPage(currentPage, pageSize, hisVO);
    }

    @PostMapping("/liststat")
    public Result<List<HisCareOrderItemSaleVo>> listStat(
            @RequestBody HisCareOrderItemVo hisCareOrderItemVo
    ) {
        System.out.println("=================" + hisCareOrderItemVo);
        return salesService.listStat(hisCareOrderItemVo);
    }
}

